#include  <stdlib.h>
#include  <conio.h>
#include  <string.h>
#include  <stdio.h>
#define N 80
int fun(char *s,char *t)
{ int n;
  char *p, *r;
  n=0;
  /*************found**************/
  r=t;
  while ( *s )
  {
	  p = s;
      while ( *r )
	  {
        if ( *r == *p )
        {
			r++;
			p++;
		}
        else
			break;
        if ( *r == '\0' )
			n++;
	  }
	  /*************found**************/
	  r=t;
      s++;
  }
  return  n;
}
void main()
{char a[N],b[N]; int m;
 
 printf("\nPlease enter string a: ");
gets(a);
 printf("\nPlease enter substring b: ");
gets(b);
 m=fun(a,b);
 printf("\nThe result is :m=%d\n",m);
}

